CREATE TABLE [dbo].[TMCLIE_TESO]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_CLIE] [dbo].[TD_VC_020] NOT NULL,
[TI_DCTO] [dbo].[TD_VC_003] NULL,
[NO_CLIE] [dbo].[TD_VC_100] NULL,
[FE_INGR] [dbo].[TD_DT_001] NULL,
[CO_TIPO_CLIE] [dbo].[TD_VC_003] NULL,
[TI_NATU_JURI] [dbo].[TD_VC_001] NULL,
[TI_DOCU_IDEN] [dbo].[TD_VC_003] NULL,
[NU_DOCU_IDEN] [dbo].[TD_VC_020] NULL,
[NU_RUCS] [dbo].[TD_VC_020] NULL,
[NU_RUCS_0002] [dbo].[TD_VC_020] NULL,
[CO_VEND] [dbo].[TD_VC_008] NULL,
[CO_COND_VENT] [dbo].[TD_VC_003] NULL,
[PO_DCTO_CLIE] [dbo].[TD_NU_009_004] NULL CONSTRAINT [DF__TMCLIE_TE__PO_DC__2A563856] DEFAULT ((0)),
[NI_PREC] [dbo].[TD_VC_001] NULL,
[CO_MONE_CRED] [dbo].[TD_VC_003] NULL,
[IM_LIMI_CRED] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TMCLIE_TE__IM_LI__2B4A5C8F] DEFAULT ((0)),
[IM_CRED_EXED] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TMCLIE_TE__IM_CR__2C3E80C8] DEFAULT ((0)),
[IM_CRED_USAD] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TMCLIE_TE__IM_CR__2D32A501] DEFAULT ((0)),
[CO_ZONA] [dbo].[TD_VC_003] NULL,
[DE_OBSE] [dbo].[TD_VC_100] NULL,
[TI_SITU] [dbo].[TD_VC_003] NULL,
[AP_PATE_CLIE] [dbo].[TD_VC_020] NULL,
[AP_MATE_CLIE] [dbo].[TD_VC_020] NULL,
[NO_NATU_0001] [dbo].[TD_VC_020] NULL,
[NO_NATU_0002] [dbo].[TD_VC_020] NULL,
[NO_RAZO_SOCI] [dbo].[TD_VC_100] NULL,
[NO_REPR] [dbo].[TD_VC_100] NULL,
[CO_DOCU_SUNA] [dbo].[TD_VC_003] NULL,
[NU_DOCU_SUNA] [dbo].[TD_VC_020] NULL,
[TI_PERS_SUNA] [dbo].[TD_VC_003] NULL,
[NU_RETE_SUNA] [dbo].[TD_VC_020] NULL,
[ST_CTRL_CRED] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TMCLIE_TE__ST_CT__2E26C93A] DEFAULT ('N'),
[NO_AVAL] [dbo].[TD_VC_100] NULL,
[DE_DIRE_AVAL] [dbo].[TD_VC_100] NULL,
[NU_RUCC_AVAL] [dbo].[TD_VC_020] NULL,
[ST_BCON] [dbo].[TD_VC_001] NULL,
[NU_TELE_AVAL] [dbo].[TD_VC_020] NULL,
[ST_RETE] [dbo].[TD_VC_001] NULL,
[CO_GRUP_ECON] [dbo].[TD_VC_006] NULL,
[NU_DIAS_PLAZ] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TMCLIE_TE__NU_DI__300F11AC] DEFAULT ((0)),
[ST_PERC] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TMCLIE_TE__ST_PE__310335E5] DEFAULT ('N'),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TMCLIE_TE__CO_US__32EB7E57] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TMCLIE_TE__FE_US__33DFA290] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TMCLIE_TE__CO_US__34D3C6C9] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TMCLIE_TE__FE_US__35C7EB02] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMCLIE_TESO] WITH NOCHECK ADD CONSTRAINT [CK__TMCLIE_TE__ST_CT__2F1AED73] CHECK NOT FOR REPLICATION (([ST_CTRL_CRED]='N' OR [ST_CTRL_CRED]='S'))
GO
ALTER TABLE [dbo].[TMCLIE_TESO] WITH NOCHECK ADD CONSTRAINT [CK__TMCLIE_TE__ST_PE__31F75A1E] CHECK NOT FOR REPLICATION (([ST_PERC]='N' OR [ST_PERC]='S'))
GO
ALTER TABLE [dbo].[TMCLIE_TESO] ADD CONSTRAINT [PK__TMCLIE_T__3BF1B977331666E0] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_CLIE]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMCLIE_TESO] ADD CONSTRAINT [FK__TMCLIE_TE__CO_EM__74100195] FOREIGN KEY ([CO_EMPR]) REFERENCES [dbo].[TMPARA_TESO] ([CO_EMPR])
GO
ALTER TABLE [dbo].[TMCLIE_TESO] ADD CONSTRAINT [FK__TMCLIE_TE__CO_TI__731BDD5C] FOREIGN KEY ([CO_TIPO_CLIE]) REFERENCES [dbo].[TTTIPO_CLIE] ([CO_TIPO_CLIE])
GO
